package com.otherTest.keyWords.forKeyWord;

import org.junit.Test;

/**
 * @author Conceit
 * @version 1.0, 2017/3/11
 */
public class TestFor {

    int repeatNumbe = 2;


    @Test
    public void testFor() {

        int y = 0;
        String result = null;
        if (result == null) {
            for (int i = 0; i <= repeatNumbe; i++) {
                System.out.println("操作enno失败！正在进行第" + new Integer(i + 1) + "次尝试！" + "超过" + new Integer(repeatNumbe + 1) + "次就自动终止！！");
//                if () {
//
//                    break;
//                }


               y++;
                System.out.println("for循环内的Y是："+y);
            }

            if (y == new Integer(repeatNumbe+1)) {
                System.out.println("尝试次数已经用完！！");
            }
            y = 0;

        }

        System.out.println("最终y的值是："+y);
    }

    @Test
    public void test2(){
        int [] t2={1,2,3,4,5,6,7};
        System.out.println(t2.length);
        for(int i=0;i<t2.length;i++){
            System.out.println(t2[i]);
        }
    }
}
